package com.hqyj.controller;


import com.hqyj.pojo.Supplier;
import com.hqyj.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;


@RestController
@RequestMapping("/supplier")
public class SupplierController {
    @Autowired
    SupplierService supplierService;

    //加载表格数据
    @RequestMapping("/supplierList")
    public  HashMap<String,Object> listPage(Supplier s){
        return supplierService.select(s);
    }
    //修改
    @RequestMapping("/update")
    public HashMap<String,Object>  update(Supplier s){ return supplierService.update(s);
    }
    //新增
    @RequestMapping("/add")
    public HashMap<String,Object> add( Supplier s){
        return supplierService.add(s);
    }

    //删除
    @RequestMapping("/del")
    public HashMap<String,Object> del(Integer id){
        return supplierService.del(id);
    }

}
